<template>
    <div>
        <el-drawer v-model="showDrawer" title="I am the title" :with-header="false" :close-on-click-modal="false"
            :destroy-on-close="true" :append-to-body="true" direction="right">
            <slot></slot>
        </el-drawer>
    </div>
</template>
<script>
export default {
    props: {
        show: {
            type: Boolean,
            default: false
        }
    },
    data() {
        return {
            showDrawer: false
        }
    },
    watch: {
        show: {
            handler(newval) {
                this.showDrawer = newval
            },
            immediate: true
        },
        showDrawer(newval) {
            this.$emits('update:show', newval)
        }
    }
}
</script>
